package com.verisette.ncos.service.master.gateway;

import java.util.List;
import java.util.Map;

import org.corp.agi.common.util.BeanContextFactory;
import org.corp.agi.service.bean.ServiceRequest;
import org.corp.agi.service.bean.ServiceResponse;
import org.corp.agi.service.bizprocess.BusinessProcess;
import com.verisette.ncos.persistence.domain.CustomMasterUserProfile;
import com.verisette.ncos.persistence.domain.LogUserAccess;
import com.verisette.ncos.persistence.domain.MasterUserProfile;

public class UserProfileManagementServiceImpl implements UserProfileManagementService {

	@Override
	public ServiceResponse createUserProfile(ServiceRequest<Map<String, Object>> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("createUserProfileProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<List<CustomMasterUserProfile>> inquiryUserProfile(ServiceRequest<MasterUserProfile> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("inquiryUserProfileProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<List<CustomMasterUserProfile>> viewUserProfile(ServiceRequest<MasterUserProfile> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("viewUserProfileProcess");
		return process.execute(request);
	}
	
	@Override
	public ServiceResponse editUserProfile(ServiceRequest<Map<String, Object>> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("editUserProfileProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse<List<LogUserAccess>> viewAccessLogUserProfile(ServiceRequest<MasterUserProfile> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("viewAccessLogUserProfileProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse resetUserPassword(ServiceRequest<Map<String, Object>> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("resetUserPasswordProcess");
		return process.execute(request);
	}

	@Override
	public ServiceResponse changeUserLockFlag(ServiceRequest<Map<String, Object>> request) {
		BusinessProcess process = (BusinessProcess) BeanContextFactory.getBean("changeUserLockFlagProcess");
		return process.execute(request);
	}
	
}
